/*
package com.weactivity;

import com.weactivity.entity.Resource;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        // 示例数据
        Resource r1 = new Resource("Resource1");
        Resource r2 = new Resource("Resource2");
        Resource r3 = new Resource("Resource1");
        Resource r4 = new Resource("Resource3");
        Resource r5 = new Resource("Resource2");

        List<Resource> mid_list = new ArrayList<>();
        mid_list.add(r1);
        mid_list.add(r2);
        mid_list.add(r3);
        mid_list.add(r4);
        mid_list.add(r5);

        // 目标列表
        List<Resource> usableList = new ArrayList<>();

        // 使用 Set 去重
        Set<String> seenNames = new HashSet<>();
        Iterator<Resource> iterator = mid_list.iterator();
        while (iterator.hasNext()) {
            Resource resource = iterator.next();
            if (seenNames.add(resource.getName())) {
                usableList.add(resource);
            }
        }

        // 输出结果
        usableList.forEach(System.out::println);
    }
}
*/
